<template>
	<view>
		<cu-custom bgColor="bg-blue" :isBack="true">
			<block slot="backText "></block>
			<block slot="content">企业列表</block>
		</cu-custom>
		<view class="companylist_box flex" v-for="(item,index) in list" :key='index' @tap="skip(item.company_id)">
			<image :src="item.logo" class="company-img"></image>
			<view class="company_textbox">
				<view class="comtext_box">{{item.company_name}}</view>
				<view class="classify_box">互联网/电子商务 计算机软件</view>
				<view class="company_num">民营 | 100-499人</view>	
			</view>
			<view class="iconfont icon-you1 rg_box"></view>
		</view>
	</view>
</template>

<script>
	const {
		appLogin,
		httpGet,
		httpPost
	} = require("@/utils/common.js")
	export default {
		data() {
			return {
				page: 1,
				page_size: 20,
				list: [],
				url:'http://www.555edu.com/d/file/2018-04-03/1617f058d34fa3d52031266d389580e2.jpg'
			}
		},
		onLoad() {
			appLogin((user_info) => {
				console.log(user_info)
				this.getlist()
			})
		},
		methods: {
			//获取公司列表
			getlist() {
				httpGet({
					url: '/api/company/list',
					data: {
						page: this.page,
						page_size: this.page_size

					}
				}).then(res => {
					console.log(res)
					this.list = res.result.list
				})
			},
			//跳转公司详情并传入公司id
			skip(company_id) {
				uni.navigateTo({
					url: 'enterprise?company_id=' + company_id
				})
				console.log(company_id)
			}
		}
	}
</script>

<style>
	page{
		background-color: #FFFFFF;
	}
	.companylist_box{
		width: 670rpx;
		border-bottom: rgb(238,238,238) solid 2rpx ;
		margin: auto;
		padding-top: 30rpx;
		padding-bottom: 30rpx;
		height: 175rpx;
	}
	.company-img{
		width: 100rpx;
		height: 100rpx;
		border-radius: 180rpx;
		margin-left: 10rpx;
	}
		
	.company_textbox{
		margin-left: 20rpx;
	}
	
	.comtext_box{
		font-size: 30rpx;
		color: #333333;
		margin-bottom: 10rpx;
	}
	
	.classify_box{
		font-size: 25rpx;
		color: #999999;
		margin-bottom: 6rpx;
	}
	
	.company_num{
		font-size: 25rpx;
		color: #999999;
	}

	.rg_box{
		font-size: 26rpx;
		position: absolute;
		right: 43rpx;
		margin-top: 38rpx;
	}
</style>
